package com.iOS.enums;
/**
*@Author:WenTao
*@Description:文件返回枚举类型
*@Date:9:43 2018/10/10
*/
public enum FileInfoEnum {
    SUCCESS(01,"操作成功")
    ,FAIL(00,"操作失败")
    ,NULL(02,"文件记录不存在")
    ,INNER_ERROR(03,"内部错误")
    ,NULL_USER(04,"用户不存在")
    ,NO_LOGIM(05,"未登录")
    ,NO_POWER(06,"权限不够");

    private int state;
    private String stateInfo;

    FileInfoEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum*/
    public static FileInfoEnum stateof(int state) {
        for (FileInfoEnum stateEnum : values()) {
            if (stateEnum.getState() == state) {
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }
}
